package com.open;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;


@EnableTransactionManagement
@ServletComponentScan
@MapperScan("com.open.*.dao")
@SpringBootApplication
@EnableCaching
@EnableScheduling
@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class})
public class Loanlication {
    private static final Logger LOGGER = LoggerFactory.getLogger(Loanlication.class);

    public static void main(String[] args) {
        SpringApplication.run(Loanlication.class, args);
        LOGGER.info("启动成功!!!");
    }

    @Bean(name = "multipartResolver")
    public MultipartResolver multipartResolver() {
        CommonsMultipartResolver resolver = new CommonsMultipartResolver();
        return resolver;
    }
}
